﻿<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../common/header.jsp"%>
</head>
<body>

	<div class="container " style="margin-top: 20px">
    <%@ include file="../common/top.jsp"%>

    <div class="row">
        <div class="col-sm-3">
            <c:set var="menu" value="permission" />
            <%@ include file="../common/menu.jsp"%>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">权限管理</h1>
                </div>
            </div>

            <form class="form-inline" id="searchForm" action="/permission/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <shiro:hasPermission name="permission:reload">
                <a role="button" data-url="/permission/reload.do" class="btn btn-success reload">
                    <span class="glyphicon glyphicon-refresh"></span> 加载权限
                </a>
                </shiro:hasPermission>
            </form>

            <table class="table table-striped table-hover" >
                <tr>
                    <th>编号</th>
                    <th>权限名称</th>
                    <th>权限表达式</th>
                </tr>
                <c:forEach var="entity" items="${pageInfo.list}" varStatus="s">
                	 <tr>
                        <td>${s.index+1+(pageInfo.pageNum-1)*pageInfo.pageSize}</td>
                        <td>${entity.name}</td>
                        <td>${entity.expression}</td>
                    </tr>
                </c:forEach>
            </table>

			<%@ include file="../common/page.jsp" %>
        </div>
    </div>
</div>
<script>
    $(function () {
        //加载权限按钮绑定点击事件
        $(".reload").click(function () {
            var url = $(this).data("url");
            $.messager.confirm("温馨提示", "亲,加载权限耗时很长,确定要重新加载吗", function () {
                $.get(url, function (data) {
                    doSuccess();
                });
            });
        });
    });
</script>
</body>
</html>